home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ShareWare OnLine 2
/
ShareWare OnLine Volume 2 (CMS Software)(1993).iso
/
elecmail
/
cs_mac07.zip
/
LOGON.MAC
< prev
next >
Wrap
Text File
|
1993-03-28
|
23KB
|
588 lines
4
┌────────────────────────────────┐
│ Chuck Seyboldt's COMMO Macro │ CS-MAC07:LOGON.MAC
└────────────────────────────────┘
*
* Contents: Generic logon routine (:glr)
* Test for ACTION (and call to ACTION.MAC)
* Get NEWFILES list if %flag contains "n"
* Getting to mail door
* Rename .QWK packets
* Test for .REP
*
* Called from: TABLE.MAC
*
* Control passes to: ACTION.MAC,action (if ACTION.%abbr exists)
* COMMO.MAC,aln (multi-dialer routine)
*
* The file you are reading does *NOT* require editing.
*
*** BBSID particulars need to be added to COMMO.FON.
*
* This file contains a logon macro.
* It is designed to get you quickest to the "Main BBS Command?"
* prompt. BBSware specific prompts are delivered from TABLE.MAC.
* After logon, a MAILRUN is made. If the Commo variable BBSID is
* empty, control passes back to COMMO.MAC.
*
* This works for PCBoards, for the RBBS run by Jim Goodenough,
* Directory Assistance (1,707 823-9516), for Shad Muegge's
* BABBLE BBS (1,707 538-1507), for Mark Turner's ESCape running
* GAP software (1,714 698-9568), for Mike Martell's Wolf's Moon
* running Spitfire (1,207 772-9093), for Jeff Oberlee's Charlies
* Foxhole BBS running MAXIMUS-CBCS (1,517 323-3405), and for
* Wildcat! boards.
* Always adding more prompts to accomodate more BBS types.
* In general, turn any BBS HOTKEY option to OFF.
*
┌─────────────────────────────┐
│ Standard Online Responses │ (For the Generic Logon Routine)
└─────────────────────────────┘
* Responses to common logging-on prompts.
* Notice that I have a different response to the "First name?"
* prompt for the BBS called Directory Assistance.
{:retu} {retu} ;Handy label and function assignment
{:lof} {comp abbr,di} {ifco lof1} ;If BBS=DIRASNT, send TURBO login
{send ~%name%|} {retu} ; otherwise, just send name.
{:lof1} {send %name %_pas !main|}
{alarm 1} {retu}
{:lov} {send ~%v_ph%|} {retu} ;Voice Phone Number verification
{:lod} {send ~%d_ph%|} {retu} ;Data Phone Number verification
{:lob} {send ~%b_day%|} {retu} ;Birthday verification
{:loq} {send ~%grafix%|} {retu} ;choose ANSI colors "Y/n"
{:bbs|} {send ~bbs|} {retu}
{:|} {send ~|} {retu}
{:_|} {send ~ |} {retu}
{:c|} {send ~c|} {retu}
{:g|} {send ~g|} {retu}
{:n|} {send ~n|} {retu}
{:q|} {send ~q|} {retu}
{:s|} {send ~s|} {retu}
{:y|} {send ~y|} {retu}
{:z|} {send ~z|} {retu}
{:0|} {send ~0|} {retu}
{:_} {send ~ } {retu} ;this is how to send "SpaceBar"
{:loe} {send ~~^[^[} {retu} ;this is sending two "Esc" presses
{:pas|} {send %_pas|} {retu} ;this sends your password
┌─────────────────────────┐
│ Generic Logon Routine │
└─────────────────────────┘
* This logon macro works for times you DON'T want to
* make a mail run. It is designed to get you quickest to the
* "Main BBS Command?" prompt.
*
* It is necessary that this routine be reached via TABLE.MAC
* since several BBS prompts are set there.
{:glr}
disp ,,,Logging on Now^m^j^j
spdc n ;Blind display "for the bold"
{sete-p0 esc} ;point to ESCape routine
{setv nodl} {setv count} ;set some working variables
{capt n} ;turnoff capture if open
{setl 60,bye,15,|}
{push} ;push + pops ≈ call
{ifca ,alm} ;Skip routine if OFFline
{golo alm,NO CARRIER^m} ;Forces skip when carrier lost
{golo _|,Login: } ;NLBBS Front End
{golo n|,A>?} ;just say 'no' RBBS prompt
{golo n|,change?} ;PCBoard "Language" prompt
{golo loq,hics (} ;PCBoard "Graphics" prompt
{golo loq, yes :} ;GAP "Graphics" prompt
{golo y|,orrect?} ;send 'y' when caller ID is asked
{golo y|,? [y/N]} ;Spitfire "Graphics" prompt
{golo onl,mmand?} ;Logged on via "quick" RBBS logon
{golo loe, twice} ;send Escape twice "Front End"
{golo loe, (ESC)} ;send Escape twice "Binkley"
{golo loe,ESCape} ;send Escape, another Binkley
{golo y|, [Y,n]?} ;MAXIMUS BBS "name?" confirmation
{golo lof,%nam_pmt} ;send name "Prompt from TABLE.MAC"
{look Password} ;Logon macro now has two "lookfors"
{pops} ; Why? To accomodate more golooks.
{paus 1}
{call pas|} ;send password
{push}
{ifca ,alm} ;Skip routine if OFFline
{setl 60,bye,20,n|} ;Start of "Logon, Part II"
{golo %bypass1} ;These BBSware specific 'pause-
{golo %bypass2} ; avoiding-responses' are set in
{golo %bypass3} ; TABLE.MAC
{golo n|,More?} ;just say 'no' to "More?"
{golo n|,inue?} ;just say 'no' to "Continue?"
{golo n|,=yes?} ;just say 'no' to "mail scan"
{golo lod,TA ph} ;More Wildcat! prompts <sigh>
{golo n|,menu? [} ;No to Wildcat! bulletin menu
{golo c|,se- [C]} ;[C]ontinue to -pause- prompt
{golo n|,N)?} ;just say 'no' RBBS prompt
{golo n|,[Y/n]} ;just say 'no' to "mail scan"
{golo pas|,Wrong} ;resend password if necessary
{look %bbs_pmt} ;Generic Logon Complete
{:onl} {spdc y} {pops} ;All set. Logged-ON.
┌─────────────────────────┐
│ Call ACTION Processor │
└─────────────────────────┘
{ifex %_hom%action.%abbr%,,noact} ;CALL "ACTION processor"
{alar 1} {paus 1} {disp ,,,^j^j}
{disp ,18,1E,▌ 'S' to skip ACTION ■ Any other key continues ▐}
{disp ,,,^m}
{setg 15,doact,n} ;if response is <CR>, do!
{gets-h resp,1,doact} ;using Commo for timed branch
{comp resp,s} {ifco noact} ;15 second delay, default=do!
{:doact} {macl action.mac,action} ;ACTION.MAC Returns to :noact
┌─────────────────────────┐
│ MailRun Routine Start │
└─────────────────────────┘
┌────────────────────────────────────────────┐
│ "flagged" events may be called from here │
└────────────────────────────────────────────┘
* A %flag% variable is used to call for NEWFILE scans.
* You should set the %flag variable in COMMO.FON
* Setting .... {flag,n} ... "n" runs :NEWFILES,
*
* This facility is setup for easy expansion.
{:noact}{push}
{inst %flag,n} {ifco newfiles}
{pops}
{comp bbsid} ;Check %bbsid variable
{ifco esc} ;If empty, quit macro here
{ifca ,alm} ;If Offline, quit here
┌───────────────────┐
│ MailRun Routine │
└───────────────────┘
* Checking for a .REP file. If a REP exists, you are offered
* the option to only upload those replies. But, the default action
* is to get a QWK. This way, unattended sessions fetch a .QWK
* Or, by setting the variable %skip to "nl", you can skip the
* attempt to download mail from the "NLBBS".
{ifex %repdr\%bbsid.%rep,ask,d_l} ;GOTO mailrun routines
{:ask} {comp skip,%abbr} {ifco n_u}
{comp skip,y} {ifco n_u}
{alar 1} {paus 1} {disp ,,,^j^j}
{disp ,18,1E,▌ (C)ontinue mail d/l NOW ■ 'S' to skip d/l ▐}
{disp ,,,^m}
{setg 15,d_l,n}{gets-h resp,1,d_l} ;using Commo for timed branch
{comp resp,c} {ifco d_l} ;15 second delay, default=d/l
{comp resp, } {ifco d_l}
{comp resp,s} {ifco n_u}
{:n_u} {setv nodl,y} ;set flag to skip mail d/l
┌───────────────────────────────┐
│ Get to the Mail Door Prompt │
└───────────────────────────────┘
{:d_l} {ifca ,retu} ;return to COMMO.MAC if offline
{send ~~%dorno}
{setl 60,bye,30,%yes}
{golo byz,invalid} ;for invalid door selection
{push}
{golo |,inue>} ;for Jimmer Startup
{golo |,inue:} ;for JetMail Startup
{golo |,inue?} ;for MarkMail Startup
{golo y|,inue...} ;for QM4 prompt
{golo ndl,sorry,} ;for T.A.G. unable to enter door
{look %md_pmt} ;from TABLE.MAC prompt table
┌─────────────────┐
│ Upload a .REP │
└─────────────────┘
* If a .REP exists, it is sent before any attempt is made to download.
{:qul} {pops}
{ifca ,retu}
{ifex %repdr\%bbsid.%rep,,nup}
{send ~~u|}
{setl 30,bye,,}
{call ulrep-%mprot} ;%mprot selected in CS-MACxx.CFG
{setl 60,bye,15,|}
{push}
{golo |,inue?} ;for MarkMail
{golo y|,inue...} ;for QM4 prompt
{look %md_pmt}
┌───────────────────┐
│ Download a .QWK │
└───────────────────┘
* The ":nup" section would be skipped if you decided to skip .QWK
* downloading in the "Mailrun Routine Start, :ask" section.
{:nup} {pops}
{comp nodl,y} {ifco byz} ;Skip d/l if %nodl=y
{send ~~~d|} ;Otherwise, scan messages
{push}
{setl 100,bye,45,%yes}
{golo p_flg,extracting personal mail} ;ZIPNEWS personal mail
{golo ndl,%mt_qwk} ;eMpTy .QWK message "from TABLE.MAC"
{golo %md_brnch} ;Branch, refer to MAILware TABLE.MAC
{look Message Count}
{goto qdl}
{:p_flg}{setv pmail,y} {retu} ;Causes "P" display in Autopilot Mode
;Cleared on Alt-C or on Alt-A "No" response
┌──────────────────┐
│ Count Messages │
└──────────────────┘
* This section will skip the RENQWK and any attempt to download if
* MarkMail scans less than 30 messages for your .QWK packet.
{:mc2}
{setg ,,l,^m} ;MarkMail2 message counting
{gets count,15} ;get total message count w/ANSI
{subs count,-4,4,%count} ;take last 4 characters total
{look sages: } ;MM2 personal message count
{gets person,15} ;get personal message count w/ANSI
{subs person,-4,4,%person} ;take last 4 characters personal
{look %xfer_pmt}
{comp person,1} ;check for personal messages
{ifco-GE qdl} ; if any, do download ... but ...
{comp count,30} ;if less than 30 total messages,
{ifco-L ndl,qdl} ; then skip download
* ;else, do the qwk download
*
* Here is a counting section for Charlie's Offline reader
* It is possible to add counting routines specific to any MAILware.
* Use the variable %md_branch defined in TABLE.MAC to choose the
* appropriate message counting routine.
{:col1}
{setg ,,l,^m}
{gets count,6} ;for Charlie's Offline Reader
{subs count,-2,2,%count} ;take last 2 characters total
{look %xfer_pmt}
{comp count,25}
{ifco-L ndl,qdl}
*
* Here is a counting section for Jack Kilday's ZIPNEWS Door
{:zns1}
{setg ,,l,^m}
{gets count,7}
{subs count,-3,3,%count}
{golo ndl,%mt_qwk} ;ZIPNEWS "empty" occurs after count
{look %xfer_pmt}
{comp count,10}
{ifco-L ndl,qdl}
┌────────────────────────────┐
│ .QWK rename and Download │
└────────────────────────────┘
* Renaming is much faster with one call to a batch file than several
* COMMO calls to command.com. Passing these variables from COMMO.MAC
* to renqwk.bat. %1 = %qwkdr : %2 = %bbsid : %3 = %abbr %4 = %qwk
*
*┌─────────────── renqwk.bat ─┐ <-- cut here --
*│ @echo off │
*│ ctty nul │
*│ │
*│ del %1\%3__5.%4 │
*│ ren %1\%3__4.%4 %3__5.%4 │
*│ ren %1\%3__3.%4 %3__4.%4 │
*│ ren %1\%3__2.%4 %3__3.%4 │
*│ ren %1\%3__1.%4 %3__2.%4 │
*│ ren %1\%2.%4 %3__1.%4 │
*│ │
*│ ctty con │
*└──────────────────────────────┘ <-- cut here --
*
* An option to the BAT file renaming method is to do renaming
* with a macro. Several macro methods are later in this file.
* You choose which method to use by presence or absence of renqwk.bat
* in your Commo home directory.
*
* renqwk.bat present in Commo home directory ... use renqwk.bat
* renqwk.bat absent from Commo home directory ... use :renqwk macro
{:qdl} {pops}
{push} ;return here from :renqwk
{ifex %qwkdr\%bbsid.%qwk,,gonow} ;check for .QWK before rename
{ifex %_hom%renqwk.bat,,renqwk} ;use .BAT if it exists
* ; otherwise use :renqwk routine
* ; in Commo macro language
*
{exec-n %_hom%renqwk %qwkdr %bbsid %abbr %qwk} ;.QWKfile rename
* ; via renqwk.bat
{:gonow}{send ~~%yes}
{call dlqwk-%mprot} ;download the .qwk
{:ndl} {pops}
{setl 30,bye,10,%no}
{comp mail,dcq} ;DCQwk does not have a logoff
{ifco md_bbs} ; from door facility.
{comp mail,zns} ;ZIPNEWS returns to BBS after d/l,
{ifco md_bbs} ; so set lookfor prompt to = BBS
{goto notag} ; command? prompt
{:md_bbs}
{golo md_2,Returning . . .};ZIPNEWS returning to PCBoard
{look %md_pmt}
{send %quit}
{:md_2} {setv quit,|} ;Reset %quit
{setv mail}
{setv md_pmt,%bbs_pmt} ;This returns to BBS for logoff.
{:notag}{push}
{golo y|,inue...} ;for QM4 "continue" prompt
{golo |,inue?} ;for MarkMail
{look %md_pmt} ;from MailDoor prompt table
┌───────────────────────────────────────────────────────────────────┐
│ Loop to TABLE.MAC and LOGON:noact for multiple doors in one call │
└───────────────────────────────────────────────────────────────────┘
* The variable %bbs is set to NUL on the first pass through TABLE.MAC.
* If TABLE.MAC,%mail is called with a NUL %bbs variable, TABLE.MAC will
* return control to LOGON:noact
* To enter a second door on one call, set a variable, %door2, in
* COMMO.FON. You will set %mail, %dorno, and %bbsid in %door2.
* Example; (door2,znr,zipnews cboldt|,nlbbs)
{:byz} {pops}
{comp door2} ;is there a %door2 variable?
{ifco byz2} ;if not, bye now!
{send %quit} ;quit the mail door
{setl 60,bye,10,|} ;send empty CR to clear "extra" commands
{look %bbs_pmt}
{inst door2,,} ;find first "," in %door2
{setv pos,%_pos} {decr pos}
{subs mail,1,%pos,%door2} ;portion before "," is %mail (MAILWare)
{incr pos,2}
{subs door2,%pos,80,%door2};portion after "," is %dorno and %bbsid
{inst door2,,} ;find second "," in %door2
{setv pos,%_pos} {decr pos}
{subs dorno,1,%pos,%door2} ;portion before "," is %dorno entry command
{incr pos,2}
{subs bbsid,%pos,9,%door2} ;portion after "," is %bbsid
{setv door2} ;clear second door variable
{macl table.mac,qwk} ;Will return to LOGON.MAC:noact
┌──────────────────────┐
│ LogOFF or Stay on? │
└──────────────────────┘
* Again a choice. Default is to end the connection, but you may
* stay ONLINE if you wish. The macro is setup to open a capture
* file if you choose to stay online.
{:byz2} {paus 1} {alarm 1} {parm ,,,,0} {disp ,,,^j^j}
{disp ,18,1E,▌ 'G' to LogOFF NOW ■ SpaceBar to stay ON ▐}
{disp ,,,^m}
{setg 10,bye,n} {gets-h resp,1,bye};using Commo for timed branch
{comp resp,g} {ifco bye} ;10 second delay, default=bye
{comp resp, } {ifco sta}
{:sta} {clea}
{setv bbsid}
{setv capture} ;clear flag to avoid closing .CAP
{macl %_mac,chm} ;commo.mac:chm opens capture file
{:bye} {ifca ,alm} ;Skip routine if OFFline
{send %bye%%rs}
{setl 10,,,}
{push}
{golo loe,<esc>} ;stifle host delays
{golo y|, log off }
{golo n|, comment }
{golo |,?=help]?} ;Charlie's Foxhole
{look NO CARRIER^m^j} ;comes from modem
{pops}
{:bya} {hang y}
{setv lastcall,%bbsid} ;save lastcall info
{setv bbsid} {setv dorno} ;and recycle variables
{setv nodl} {setv abbr}
{paus 5}
{macl %_mac,%rflag} ;Dial next marked BBS
{:alm} {setv bbsid} ;if exit w/NO CARRIER
{setv abbr} ; this macro routine
{macl %_mac,%rflag}
{:esc} {setv bbsid} ;if exit by pressing ESCape
{setv abbr}
{macl %_mac}
┌──────────────────────────────┐
│ .QWK file rename via macro │
└──────────────────────────────┘
* There are many ways to rename mail packets. The variable %rdr
* is used to branch to whatever rename method you prefer. The
* default method uses the date as part of the name and allows
* up to 10 .qwk packets of the same date
* (NL-1108.QWK --> NL-1108.QW0 --> NL-1108.QW1 --> etc.)
*
* It would be very easy to change this progression to keep
* the file extension ".qwk"
* (NL-1108.QWK --> NL-11080.QWK --> NL-11081.QWK --> etc.)
{:renqwk}
{comp rdr} {ifco ,%rdr}
{:qwk} {ifex %qwkdr\%abbr%-%_mon%%_day.%qwk,m_dat}
{exec-n ren %qwkdr\%bbsid.%qwk %abbr%-%_mon%%_day.%qwk}
{retu}
{:m_dat}{setv count,0}
{:m_lop}{ifex %qwkdr\%abbr%-%_mon%%_day.qw%count,,r_mul}
{incr count}
{goto m_lop}
{:r_mul}{exec-n ren %qwkdr\%bbsid.%qwk %abbr%-%_mon%%_day.qw%count}
{retu}
* Rename method ala JABBER.
*
{:jbr} {exec-n dir %qwkdr\%bbsid.* > %ramdr\temp}
{setv ext,0}
{rope %ramdr\temp,j_ren}
{:jbr_l}{read line}
{subs count,10,3,%line}
{comp count,%ext}
{ifco-ge ,jbr_l}
{setv ext,%count}
{goto jbr_l}
{:j_ren}{incr ext}
{leng %ext}
{comp %_len,3} {ifco n_pad}
{comp %_len,2} {ifco 1_pad}
{setv ext,0%ext}
{:1_pad}{setv ext,0%ext}
{:n_pad}{exec-n ren %qwkdr\%bbsid.%qwk %bbsid.%ext}
{retu}
* Rename method ala ZIPNEWS
*
{:znr} {exec-n dir %znpak\%bbsid.z* > %ramdr\temp}
{setv ext,0}
{rope %ramdr\temp,z_ren}
{:znr_l}{read line}
{subs count,11,2,%line}
{comp count,%ext}
{ifco-ge ,znr_l}
{setv ext,%count}
{goto znr_l}
{:z_ren}{incr ext}
{leng %ext}
{comp %_len,2} {ifco no_pd}
{setv ext,0%ext}
{:no_pd}{exec-n ren %znpak\%bbsid.%qwk %bbsid.z%ext}
{retu}
┌──────────────────────────────────────┐
│ .QWK and .REP protocol subroutines │
└──────────────────────────────────────┘
* This arrangement provides a method to use a variety of mail
* transfer protocols.
┌──────────┐
│ Zmodem │
└──────────┘
{:ulrep-z}
{:ulrep-} ;default protocol is "Z"
{look ^xB01} ;Zmodem .REP Upload
{exec-n %z_prog port %_por ha bo sz -m %repdr\%bbsid.%rep}
{ifer 1,,delrep}
{retu}
{:dlqwk-z}
{:dlqwk-} ;default protocol is "Z"
{push} ;Zmodem .QWK Download
{golo g|,<G> to start} ;for DCQwk/TAG
{look ^xB00}
{pops}
{exec-n %z_prog port %_por ha bo rz -mr %qwkdr}
{retu}
┌──────────┐
│ Ymodem │
└──────────┘
{:ulrep-y} ;Ymodem .REP Upload
{paus 5}
{symo-k %repdr\%bbsid.%rep}
{ifer 1,,delrep} ;Goto delete .REP if trans OK
{retu}
{:dlqwk-y} ;Ymodem .QWK Download
{paus 5}
{send g} ;for DCQwk/TAG
{rymo-y %qwkdr} ;overwrite exiting files
{retu}
┌──────────┐
│ Xmodem │
└──────────┘
{:ulrep-x} ;Xmodem .REP Upload
{paus 5}
{sxmo-k %repdr\%bbsid.%rep}
{ifer 1,,delrep} ;Goto delete .REP if trans OK
{retu}
{:dlqwk-x} ;Xmodem .QWK Download
{paus 5}
{send g}
{rxmo-y %qwkdr\%bbsid.%qwk}
{retu}
┌────────────────────┐
│ .REP File Delete │
└────────────────────┘
{:delrep}
{exec-n del %repdr\%bbsid.%rep}
{retu}
┌────────────────────────────────────────┐
│ Functions called from %flag variable │
└────────────────────────────────────────┘
{:newfiles}
{setv strip,n}
{call stripflag}
{clea}
{send n s u|}
{capt y,%savedir\newfiles.%abbr}
{push}
{golo |,more?}
{look %bbs_pmt}
{pops}
{clea}
{capt n}
{send ~~|}
{retu}
┌──────────────────────────────────────────┐
│ Strip the acted-on function from %flag │
└──────────────────────────────────────────┘
* This subroutine strips the variable %flag of one character
* so that each %flag function is run only once.
{:stripflag}
{inst %flag,%strip}
{comp _pos,1} {ifco fl2}
{setv pos,%_pos} {decr pos}
{subs flag1,1,%pos,%flag}
{:fl2} {setv pos,%_pos} {incr pos}
{subs flag2,%pos,36,%flag}
{setv flag,%flag1%%flag2}
{setv pos}
{setv strip}
{setv flag1}
{setv flag2}
{retu}